use crate::runtime::response::MagicBoxResponse;
use crate::runtime::result::MagicBoxResult;
use crate::state;

#[tauri::command(rename_all = "snake_case")]
pub(crate) async fn invoke_open_console() -> MagicBoxResult<MagicBoxResponse<()>> {
    let window = state::application::application().window();
    if window.is_some() {
        #[cfg(debug_assertions)]
        window.unwrap().open_devtools();
    }

    Ok(MagicBoxResponse::new_empty_success())
}